class Solution:
    def maxArea(self, height: List[int]) -> int:
        l=0
        r=len(height)-1
        maxs=0
        while r-l>0:
            maxs = self.func1(maxs,height[r],height[l],r-l)
            if height[r]>=height[l]:
                l+=1
            else:
                r-=1
        return maxs

    def func1(self,maxs,a,b,c):
        if min(a,b)*c>=maxs:
            maxs=min(a,b)*c
        return maxs